package cn.dengta.webapp.trade.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/***
 * 金币交易 规则配置
 */
@Getter
@Setter
@Component
@ConfigurationProperties(prefix = "trade.gold")
public class GoldTradeProperties {

	/** 1钻石 = 10金币 */
	private Integer coinToGold = 10;

	public Integer getCoins(Integer gold) {
		return gold / coinToGold;
	}

	public Integer getGold(Integer coins) {
		return coins * coinToGold;
	}

}
